<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量</title>
</head>
<body>
    
</body>
<script>
    // 创建变量
    let num;
    num = 10;
    console.log(num);
    let str;
    console.log(str);//未定义
    // 常量：定义之后不能修改
    const userName = 'admin';
    console.log(userName);
    userName = 'xiaoming';//不可以重新给常量赋值，执行代码会报错。
    console.log(userName);
</script>
</html>